gdkarray: Inline splice and reserve
authorAlexander Larsson <alexl@redhat.com>
Tue, 29 Sep 2020 13:57:33 +0000 (15:57 +0200)
committerAlexander Larsson <alexl@redhat.com>
Tue, 29 Sep 2020 13:57:33 +0000 (15:57 +0200)
This inlines the splice and reserver GdkArray calls. These are
typically only called from the gdk_array_(append/set_size) functions
anyway, and inlining the caller means we can constant propagate the
constant arguments in those calls. Its hard to get exact numbers, but
in fishbowl i noticed a significant decrease in the time spent in
the array code when pushing and poping states.

gdk/gdkarrayimpl.c

index 6692245aa755e3d2689ec5cbff51f20c9a8ca917..65b74a3f59a3f9a34cfc060dccfbacdd7cd31bda 100644 (file)
@@ -141,7 +141,7 @@ gdk_array(is_empty) (const GdkArray *self)
   return self->end == self->start;
 }
 
-G_GNUC_UNUSED static void
+G_GNUC_UNUSED static inline void
 gdk_array(reserve) (GdkArray *self,
                     gsize      n)
 {
@@ -178,7 +178,7 @@ gdk_array(reserve) (GdkArray *self,
 #endif
 }
 
-G_GNUC_UNUSED static void
+G_GNUC_UNUSED static inline void
 gdk_array(splice) (GdkArray *self,
                    gsize      pos,
                    gsize      removed,